#define _CRT_SECURE_NO_WARNINGS 1

class Solution {
public:
    double minimumAverage(vector<int>& nums) {
        sort(nums.begin(), nums.end());
        int left = 0, right = nums.size() - 1;
        int min1 = INT_MAX;
        while (left < right)
        {
            int cnt = nums[left++] + nums[right--];
            min1 = min(cnt, min1);
        }
        return min1 / 2.0;
    }
};